<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>倒计时5秒跳转页面</title>
    <style>
        div{
            text-align: center;
        }
    </style>
</head>
<body>
    <div>
        恭喜您！注册成功，<span id="Jump" style="color: red; font-size: 20px;">5</span>秒后跳转登录页面!<br />
        跳转，<a href="login.html" target="_self">点击这里</a>
    </div>
</body>
<script type="text/javascript">
    var time=4;
    var timer = setInterval(function(){
        var str = document.getElementById("Jump");
        if(time>=1){
            str.innerHTML=time;
            time--;
        }else{
            clearInterval(timer);
            location.href = "login.html";
        }
    },1000)
</script>
</html>
